#ifndef _basic_func_h
#define _basic_func_h
/* check sum
 */

#include "macrodriver.h"

extern   INT32U GetCheckSum( void const * const  ptr, INT16U len );

extern bool IsBcdCode( INT8U const * const bcd, INT8U len ); 

extern INT24U Hex2Bcd( INT24U hex );

extern INT8U Hex2Bcd( INT8U hex );

extern INT8U Bcd2Hex( INT8U bcd );

extern INT16U Hex2Bcd( INT16U hex );

extern  INT16U Bcd2Hex( INT16U bcd );

extern INT32U Hex2Bcd( INT32U hex );

extern  INT32U Bcd2Hex( INT32U bcd );

extern INT24U Bcd2Hex( INT24U bcd );

extern INT32U BcdAdd( INT32U bcd1, INT32U bcd2 );

extern  INT16U BcdAdd( INT16U bcd1, INT16U bcd2 );

extern INT8U BcdAdd( INT8U bcd1, INT8U bcd2 );

extern INT32U BcdSub( INT32U bcd1, INT32U bcd2 );

extern INT16U BcdSub( INT16U bcd1, INT16U bcd2 );

extern INT8U BcdSub( INT8U bcd1, INT8U bcd2 ); 

extern bool IsEqualSpecialData( INT8U* src, INT8U data, INT8U len );

extern bool IsEqual( INT8U* src1, INT8U* src2, INT8U len );

extern INT8U Find_Item( const INT8U* item_table, INT8U item );

void Delay( INT16U t );

#define IsPowerOff()   LVIF
#define IsPowerOn()   (!(LVIF))

#define IsProgramDown()     g_SoftTimer.Time_IsTimeLive(e_time_Cancle_program)

extern void SetMaterReInital(INT8U time);  

extern bool IsInitalUp(void);
extern bool IsInitalDwon(void);

extern char *StrIntoStr(char *s1,char *s2,INT8U s1Len,INT8U s2Len,INT8U pos);
#endif 
